<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>设置类样式方法</title>
</head>
<script src="js/jquery-1.12.4.min.js"></script>
<script>
  $(function(){

    $('.btn1').click(function(){
      $('.btn').addClass('current');
    });

     $('.btn2').click(function () {
      $('.btn').removeClass('current');
    });

     $('.btn3').click(function () {
      $('.btn').toggleClass('current');
    });
    
  });
</script>
<body>
  <div class="main">
    <div class="btn"></div>
    <div class="btn"></div>
    <div class="btn"></div>
    <div class="btn"></div>
    <div class="btn"></div>
    <button class="btn1 btns">添加</button>
    <button class="btn2 btns">删除</button>
    <button class="btn3 btns">切换</button>
  </div>
  <div class="main1">
    span*10{测试}
  </div>
</body>
<style>
  .main{
    display: flex;
    align-items: center;
  }
  .btn{
    width: 100px;
    height: 50px;
    background-color: blue;
    border-radius: 5px;
    margin: 10px;
  }
  .current{
    background-color: chartreuse;
  }
  .btns{
    margin-left: 20px;
  }
</style>
</html>